// @ts-ignore
/* eslint-disable */
import request from '@/utils/request';

/** 添加用户 POST /api/user/add */
export async function addUserUsingPost(body: API.User, options?: { [key: string]: any }) {
  return request<API.ResponseResultBoolean_>('/api/user/add', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除用户 POST /api/user/delete */
export async function deleteUserUsingPost(
  body: API.DeleteRequest,
  options?: { [key: string]: any },
) {
  return request<API.ResponseResultBoolean_>('/api/user/delete', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 获取用户签到记录 GET /api/user/get/sign */
export async function getUserSignInUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getUserSignInUsingGETParams,
  options?: { [key: string]: any },
) {
  return request<API.ResponseResultListInt_>('/api/user/get/sign', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 获取登录用户信息 POST /api/user/info */
export async function getLoginUserInfoUsingPost(options?: { [key: string]: any }) {
  return request<API.ResponseResultUser_>('/api/user/info', {
    method: 'POST',
    ...(options || {}),
  });
}

/** 获取用户列表 POST /api/user/list */
export async function listUserUsingPost(body: API.UserQueryDto, options?: { [key: string]: any }) {
  return request<API.ResponseResultPageUser_>('/api/user/list', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 登录 POST /api/user/login */
export async function loginUsingPost(body: API.LoginDto, options?: { [key: string]: any }) {
  return request<API.ResponseResultBoolean_>('/api/user/login', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 注销登录 POST /api/user/logout */
export async function logoutUsingPost(options?: { [key: string]: any }) {
  return request<API.ResponseResultBoolean_>('/api/user/logout', {
    method: 'POST',
    ...(options || {}),
  });
}

/** 注册 POST /api/user/register */
export async function registerUsingPost(body: API.RegisterDto, options?: { [key: string]: any }) {
  return request<API.ResponseResultBoolean_>('/api/user/register', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 用户签到 POST /api/user/sign */
export async function addUserSignInUsingPost(options?: { [key: string]: any }) {
  return request<API.ResponseResultBoolean_>('/api/user/sign', {
    method: 'POST',
    ...(options || {}),
  });
}

/** 更新用户信息 POST /api/user/update */
export async function updateUserUsingPost(body: API.User, options?: { [key: string]: any }) {
  return request<API.ResponseResultBoolean_>('/api/user/update', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
